// part1:C09:ex9.46.cpp
// prefix and suffix of a string.
#include <iostream>
#include <string>
#include <vector>
#include <string.h>
using namespace std;

void name_string(string& name, const string& prefix,
                 const string& suffix) {
  name.insert(0, " ");
  name.insert(0, prefix);
  name.insert(name.size(), " ");
  name.insert(name.size(), suffix);
}

int main(void) {
  string s1 = "James Bond";
  name_string(s1, "Mr", "II");
  cout << s1 << endl;

  name_string(s1, "Mrs.", "III");
  cout << s1 << endl;

  return 0;
}
